{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        {include file="public/tophead"}
        {include file="public/top" /}
        <div class="ibox-content">
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="example">
                        <table data-toggle="table" data-striped="false">
                            <thead>
                                <tr>
                                    <th>id</th>
                                    <th>角色名称</th>
                                    <th>管理</th>
                                </tr>
                            </thead>
                            <tbody>
                            {volist name="data" id="v"}
                                <tr id="id{$v.id}">
                                    <td>{$v.id}</td>
                                    <td>{$v.title}</td>
                                    <td>
                                        <div class="btn-group">
                                            <button data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">操作 <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu">
                                                <li><a onclick="add('{:url('typeAdd',['id'=>$v['id'],'url'=>-1])}')">修改</a></li>
                                                {if $v.id > 1 && $v.title != '城市代理'}
                                                <li><a onclick="del({$v.id})">删除</a></li>
                                                {/if}
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table.min.css"}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table.min.js"}
<script type="text/javascript">
    $(document).ready(function(){
    });
    function add(url){
        layer.open({
            type: 2,
            title: '权限管理',
            shadeClose: false,
            shade: 0.2,
            area: ['80%', '80%'],
            skin:'shangchuantup',
            // shift:-1,
            content: url,
        });
    }
    function del(id){
        swal_del(id,"{:url('typeDel')}", {title: '该权限'})
    }

</script>